﻿using ApplicationLibrary.SqlConnector;

namespace Plumber.Masters.ModuleData
{
    #region PL_Masters

    public class PL_Masters : Table
    {
        public static string Name = "PL_Masters";
        public static Column<bool> IsAccountingType = new Column<bool>(Name, "", "IsAccountingType", false, false);
        public static Column<string> Type = new Column<string>(Name, Properties.Resources.T_Type, "Type", LEN.SHORT_CODE, false, false);
        public static Column<string> Code = new Column<string>(Name, Properties.Resources.T_Code, "Code", LEN.CODE, false, false);
        public static Column<string> Description = new Column<string>(Name, Properties.Resources.T_Description, "Description", LEN.BIG_DESCRIPTION);
        public static Column<string> Address = new Column<string>(Name, Properties.Resources.T_Address, "Address", 128);
        public static Column<string> ZipCode = new Column<string>(Name, Properties.Resources.T_ZipCode, "ZipCode", 5);
        public static Column<string> City = new Column<string>(Name, Properties.Resources.T_City, "City", 35);
        public static Column<string> County = new Column<string>(Name, Properties.Resources.T_County, "County", 2);

        public static Column<string> Phone1 = new Column<string>(Name, Properties.Resources.T_Phone1, "Phone1", LEN.CODE);
        public static Column<string> Phone2 = new Column<string>(Name, Properties.Resources.T_Phone2, "Phone2", LEN.CODE);
        public static Column<string> Fax = new Column<string>(Name, Properties.Resources.T_Fax, "Fax", LEN.CODE);
        public static Column<string> Refer1 = new Column<string>(Name, Properties.Resources.T_Refer1, "Refer1", LEN.DESCRIPTION);
        public static Column<string> Refer2 = new Column<string>(Name, Properties.Resources.T_Refer2, "Refer2", LEN.DESCRIPTION);
        public static Column<string> Email = new Column<string>(Name, Properties.Resources.T_Email, "Email", LEN.DESCRIPTION);

        public static Column<bool> Blocked = new Column<bool>(Name, Properties.Resources.T_Blocked, "Blocked");
        public static Column<bool> Disabled = new Column<bool>(Name, Properties.Resources.T_Disabled, "Disabled");

        public static Column<string> TaxNo = new Column<string>(Name, Properties.Resources.T_TaxNo, "TaxNo", 11);
        public static Column<string> FiscalCode = new Column<string>(Name, Properties.Resources.T_FiscalCode, "FiscalCode", LEN.CODE);
        public static Column<string> Administrator = new Column<string>(Name, Properties.Resources.T_Administrator, "Administrator", LEN.CODE);

        public static Column<string> TaxCode = new Column<string>(Name, "", "TaxCode", LEN.SHORT_CODE);
        public static Column<bool> HasRestraint = new Column<bool>(Name, "", "HasRestraint");
        public static Column<string> RestraintCode = new Column<string>(Name, "", "RestraintCode", LEN.SHORT_CODE);

        public static Column<string> Title = new Column<string>(Name, Properties.Resources.T_Title, "Title", LEN.CODE);

        public override iColumn ForeignKey
        {
            get { return Code; }
        }

        public PL_Masters()
        {
            VisibleInRadar(new iColumn[] { Type, Code, Description, Address });
            DefineKey(new iColumn[] { IsAccountingType, Type, Code });
            Tablename = Name;
        }
    }

    #endregion

    #region PL_Titles

    public class PL_Titles : Table
    {
        public static string Name = "PL_Titles";

        public static Column<string> Title = new Column<string>(Name, Properties.Resources.T_Title, "Title", LEN.CODE, false, false);
        public static Column<string> Description = new Column<string>(Name, Properties.Resources.T_Description, "Text", LEN.BIG_DESCRIPTION);

        public override iColumn ForeignKey
        {
            get { return Title; }
        }

        public PL_Titles()
        {
            VisibleInRadar(new iColumn[] { Title, Description });
            Tablename = Name;
            DefineKey(new iColumn[] { Title });
        }
    }

    #endregion

    #region PL_MasterType

    public class PL_MasterType : Table
    {
        public static string Name = "PL_MasterType";

        public static Column<string> Code = new Column<string>(Name, Properties.Resources.T_Code, "Code", LEN.SHORT_CODE, false, false);
        public static Column<string> Description = new Column<string>(Name, Properties.Resources.T_Description, "Description", LEN.DESCRIPTION);
        public static Column<CodeMode> CodeMode = new Column<CodeMode>(Name, "", "CodeMode");
        public static Column<MasterTypes> MasterType = new Column<MasterTypes>(Name, "", "MasterType");
        public static Column<AccountType> AccountType = new Column<AccountType>(Name, "", "AccountType");
        public static Column<bool> CanReceiveInvoice = new Column<bool>(Name, "", "CanReceiveInvoice");

        public static Column<string> TaxCode = new Column<string>(Name, "", "TaxCode", LEN.SHORT_CODE);
        public static Column<bool> HasRestraint = new Column<bool>(Name, "", "HasRestraint");
        public static Column<string> RestraintCode = new Column<string>(Name, "", "RestraintCode", LEN.SHORT_CODE);

        public static Column<bool> IsAccountingType = new Column<bool>(Name, "", "IsAccountingType");
        public static Column<bool> DocNoRequired = new Column<bool>(Name, "", "DocNoRequired");
        public static Column<bool> CopyDocNo = new Column<bool>(Name, "", "CopyDocNo");

        public static Column<bool> IsPrefer = new Column<bool>(Name, "", "IsPrefer");

        public override iColumn ForeignKey
        {
            get { return Code; }
        }

        public PL_MasterType()
        {
            VisibleInRadar(new iColumn[] { Code, Description });
            Tablename = Name;
            DefineKey(new iColumn[] { Code });
        }
    }

    #endregion

    #region PL_TaxCode

    public class PL_TaxCode : Table
    {
        public static string Name = "PL_TaxCode";

        public static Column<string> Code = new Column<string>(Name, Properties.Resources.T_Code, "Code", LEN.SHORT_CODE, false, false);
        public static Column<string> Description = new Column<string>(Name, Properties.Resources.T_Description, "Description", LEN.DESCRIPTION);
        public static Column<double> Percent = new Column<double>(Name, "", "Percent");

        public override iColumn ForeignKey
        {
            get { return Code; }
        }

        public PL_TaxCode()
        {
            VisibleInRadar(new iColumn[] { Code, Description });
            Tablename = Name;
            DefineKey(new iColumn[] { Code });
        }
    }

    #endregion

    #region PL_Descriptions

    public class PL_Descriptions : Table
    {
        public static string Name = "PL_Descriptions";

        public static Column<DescriptionType> Type = new Column<DescriptionType>(Name, "", "Type", false, false);
        public static Column<string> Code = new Column<string>(Name, Properties.Resources.T_Code, "Code", LEN.CODE, false, false);
        public static Column<string> Description = new Column<string>(Name, Properties.Resources.T_Description, "Description", LEN.BIG_DESCRIPTION);

        public override iColumn ForeignKey
        {
            get { return Code; }
        }

        public PL_Descriptions()
        {
            VisibleInRadar(new iColumn[] { Code, Description });
            Tablename = Name;
            DefineKey(new iColumn[] { Type, Code });
        }
    }

    #endregion

    #region PL_Masters

    public class PL_Company : Table
    {
        public static string Name = "PL_Company";
        public static Column<int> Code = new Column<int>(Name, Properties.Resources.T_Code, "Code", false, false);
        public static Column<string> Description = new Column<string>(Name, Properties.Resources.T_Description, "Description", LEN.BIG_DESCRIPTION);
        public static Column<string> Address = new Column<string>(Name, Properties.Resources.T_Address, "Address", 128);
        public static Column<string> ZipCode = new Column<string>(Name, Properties.Resources.T_ZipCode, "ZipCode", 5);
        public static Column<string> City = new Column<string>(Name, Properties.Resources.T_City, "City", 35);
        public static Column<string> County = new Column<string>(Name, Properties.Resources.T_County, "County", 2);

        public static Column<string> Phone1 = new Column<string>(Name, Properties.Resources.T_Phone1, "Phone1", LEN.CODE);
        public static Column<string> Phone2 = new Column<string>(Name, Properties.Resources.T_Phone2, "Phone2", LEN.CODE);
        public static Column<string> Fax = new Column<string>(Name, Properties.Resources.T_Fax, "Fax", LEN.CODE);
        public static Column<string> Refer1 = new Column<string>(Name, Properties.Resources.T_Refer1, "Refer1", LEN.DESCRIPTION);
        public static Column<string> Refer2 = new Column<string>(Name, Properties.Resources.T_Refer2, "Refer2", LEN.DESCRIPTION);
        public static Column<string> Email = new Column<string>(Name, Properties.Resources.T_Email, "Email", LEN.DESCRIPTION);

        public static Column<string> TaxNo = new Column<string>(Name, Properties.Resources.T_TaxNo, "TaxNo", 11);
        public static Column<string> FiscalCode = new Column<string>(Name, Properties.Resources.T_FiscalCode, "FiscalCode", LEN.CODE);

        public static Column<string> Title = new Column<string>(Name, Properties.Resources.T_Title, "Title", LEN.CODE);

        public override iColumn ForeignKey
        {
            get { return Code; }
        }

        public PL_Company()
        {
            VisibleInRadar(new iColumn[] { Code, Description, Address });
            DefineKey(new iColumn[] { Code });
            Tablename = Name;
        }
    }

    #endregion
}